#ifndef	LDC1602
#define LDC1602
/*
	1602液晶显示头文件 
*/

#define uint unsigned int
#define uchar unsigned char

sbit RS=P2^1;
sbit RW=P2^2;
sbit EN=P2^3;

void delay(uint a)
{
	uchar i;
	uint j;
	for (i=0;i<110;i++)
		for(j=0;j<a;j++);
}	
void Write_com(uchar com)
{
	RS=0;
	RW=0;
	P0=com;
	delay(5);
	EN=1;
	delay(5);
	EN=0;	
}
void Write_data(uchar dat)
{
	RS=1;
	RW=0;
	P0=dat;
	delay(1);
	EN=1;
	delay(1);
	EN=0;
		
}
 void _1602init()
{
	
	EN=0;						 //使能初始化
	Write_com(0x83);			 //设置显示模式
	Write_com(0x01);			 //清屏
	Write_com(0x0c);	         //开显示设置光标，不显示光标
	Write_com(0x06);		     //设置指针，读写一个字符后地址指针加一
}
#endif